// ----------------------------------
// RSDK Project: Sonic 2 - Boss Attack Plus
// Script Description: Attack Mode
// Script Author: Tails LP
// ----------------------------------

//-------Aliases-------//

private alias object.value0 : 

// menu selections


//private alias 0 : 

// object states


private alias 0 : SONIC_TAILS
private alias 1 : SONIC
private alias 2 : TAILS
private alias 3 : KNUCKLES
private alias 4 : KNUCKLES_TAILS
private alias 5 : INACTIVE

private alias saveRAM[494] : saved.bossGameMode //7B8 SData.bin
private alias saveRAM[495] : saved.bossType //7BC SData.bin
private alias saveRAM[496] : saved.BossMusic //7C0 SData.bin
private alias saveRAM[497] : saved.Character //7C4 SData.bin
private alias saveRAM[498] : saved.TimeLimit //7C8 SData.bin
private alias saveRAM[499] : saved.superMode //7CC SData.bin

//-------Function declarations-------//

//-------Static Values-------//

//-------Tables-------//




//-------Functions-------//

function drawTailsP2
	LoadAnimation("Tails.ani")
end function




event ObjectMain

	object.animation = ANI_WAITING
	temp0 = screen.xcenter
	temp0 -= 8
	object.ixpos = temp0
	object.iypos = 96
	object[+1].iypos = 96

	if object.visible == 1
		object[+1].visible = 1
	else
		object[+1].visible = 0
	endif
	CallFunction(drawTailsP2)

		object.animationSpeed ++
		if object.animationSpeed > 7
			object.frame ++
			if object.frame > 48
				object.frame = 21
			endif
			object.animationSpeed = 0
		endif

	switch saved.Character
	case SONIC_TAILS
	case KNUCKLES_TAILS
		object.visible = 1
		break
	case SONIC
	case TAILS
	case KNUCKLES
		object.visible = 0
		break
	endswitch
end event

event ObjectDraw
	DrawObjectAnimation()
	object.drawOrder = 4
end event

event ObjectStartup
	ReadSaveRAM()

	LoadSpriteSheet("LevelSelect/Icons.gif")
	SpriteFrame(-48, -7, 96, 14, 226, 151)			//00 ATTACK
end event

event RSDKDraw
    DrawSprite(0)
end event

event RSDKLoad
    LoadSpriteSheet("Global/Display.gif")
    SpriteFrame(-16, -16, 32, 32, 223, 172)
end event